package com.sh.data.engine.mbean;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Serializable;
import java.util.Date;

/**
 * @author tyf
 * @description:
 * @date 2020-11-12 16:07
 */
public class Point implements PointMBean, Serializable {

    private static final Logger log = LoggerFactory.getLogger(Point.class);

    private Context context;

    public Point(Context context) {
        this.context = context;
    }

    @Override
    public void close() {
        log.info("关闭进程");
        context.shutDown();
        System.exit(0);
    }

    @Override
    public int getDelay() {
        return context.getDelay();
    }

    @Override
    public int failNum() {
        return context.getFailNum();
    }

    @Override
    public Date getLastSyncTime() {
        return context.getLastSyncTime();
    }

    @Override
    public String getType() {
        return context.getType();
    }
}
